const arr=[
  {name:'tom'},
  {age:18},
  {gender:'男'}
]
//遍历并且返回所有的元素
const arr2 = arr.map(item=>{
    return item
})
console.log(arr2);

const student = {
    name:'jack',
    age:19,
    gender:'男'
}
//...是所有剩余的参数
const {name,...student2}=student
console.log(student2);
const student3={
    ...student
}
console.log(student3);

const studentx=[
    {
        name: 'tom',
        age: 18,
        gender: '男'
    },
    {
        name:'rose',
        age:20,
        gender:'女'
    }
]
//结果会是[{item下的元素,postlist:[]},{item下的元素,postlist:[]}]
const str =studentx.map(item=>{
    return {
        ...item,
        postlist:[]
    }
})
console.log(str);